|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.SizeEstimator
This class maintains an estimate of the amount of memory required to store a set of objects.
SizeEstimator
is a floor on
the amount of memory that should be allocated. Many objects allocate
other objects when they are constructed.
SizeEstimator
only estimates
the memory requirement of the object itself, it does not include memory
required for any objects allocated at construction time. If the instance
itself is allocated in several parts, the size estimate shall include
the sum of the sizes of all the parts that are allocated from the same
memory area as the instance.
Alignment considerations, and possibly other order-dependent issues may cause the allocator to leave a small amount of unusable space, consequently the size estimate cannot be seen as more than a close estimate.
Not currently implemented
Constructor Summary | |
SizeEstimator()
Void constructor. |
Method Summary | |
long |
getEstimate()
Gets an estimate of the number of bytes needed to store all the objects reserved. |
void |
reserve(java.lang.Class c,
int number)
Take into account additional number instances of Class c when estimating the size of the MemoryArea . |
void |
reserve(SizeEstimator size)
Take into account an additional instance of SizeEstimator size
when estimating the size of the
MemoryArea . |
void |
reserve(SizeEstimator estimator,
int number)
Take into account additional number instances of SizeEstimator
size when estimating the size of the
MemoryArea . |
void |
reserveArray(int length)
Take into account an additional instance of an array of length
reference values when estimating the size of the
MemoryArea . |
void |
reserveArray(int length,
java.lang.Class type)
Take into account an additional instance of an array of length primitive values when estimating the size of
the MemoryArea . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SizeEstimator()
Not currently implemented
Method Detail |
public long getEstimate()
Not currently implemented
public void reserve(java.lang.Class c, int number)
MemoryArea
.Not currently implemented
c
- The class to take into account.number
- The number of instances of c
to estimate.public void reserve(SizeEstimator size)
SizeEstimator
size
when estimating the size of the
MemoryArea
.Not currently implemented
size
- The given instance of
SizeEstimator
.public void reserve(SizeEstimator estimator, int number)
SizeEstimator
size
when estimating the size of the
MemoryArea
.Not currently implemented
estimator
- The given instance of
SizeEstimator
.number
- The number of times to reserve the size
denoted by estimator.public void reserveArray(int length)
length
reference values when estimating the size of the
MemoryArea
.Not currently implemented
length
- The number of entries in the array.
java.lang.IllegalArgumentException
- Thrown if
length
is negative.public void reserveArray(int length, java.lang.Class type)
length
primitive values when estimating the size of
the MemoryArea
.
Class values for the primitive types are available from the
corresponding class types; e.g., Byte.TYPE
, Integer.TYPE
,
and Short.TYPE
.
Not currently implemented
length
- The number of entries in the array.type
- The class representing a primitive type.
The reservation will leave room for an array of
length of the primitive type corresponding to type.
java.lang.IllegalArgumentException
- Thrown if length
is negative or type does not
represent a primitive type.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |